import { createApp } from 'vue'
import './assets/less/index.less'
import App from './App.vue'
// 引入mock,全局拦截请求
import './api/mock.js'

import api from './api/api.js'
// 路由
import router from './router/index.js'
// ui组件elementplus
// import ElementPlus from 'element-plus'
// import 'element-plus/dist/index.css'
// 引入icon图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 引入仓库
import {createPinia} from 'pinia'
// pinia持久化存储插件
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
const pinia=createPinia()
pinia.use(piniaPluginPersistedstate)
const app=createApp(App)
// 定义全局属性对象
app.config.globalProperties.$api=api

app.use(router)
// 图标全局注册
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.use(pinia)
// app.use(ElementPlus)

app.mount('#app')
